package com.tanker.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tanker.order.api.OrderApi;
import com.tanker.order.dto.req.OrderCreateRequest;
import com.tanker.order.dto.resp.OrderDto;
import com.tanker.web.dto.resp.Response;

@RestController
@RequestMapping(value = "/")
public class OrderController {
	@Autowired
	private OrderApi orderApi;

	@PostMapping(value = "/order")
	public String create(OrderCreateRequest request) {
		OrderDto orderDto = orderApi.create(request);
		return Response.success(orderDto);
	}
}
